﻿
Namespace LightSwitchApplication

    Public Class RentalCheckout

        Private Sub AssetName_Compute(ByRef result As String)
            ' Set result to the desired field value
            If Not AssetInformation Is Nothing Then
                result = Me.AssetInformation.Name
            End If

        End Sub

       
        Private Sub ExpectedReturnDate_Validate(results As EntityValidationResultsBuilder)
            ' results.AddPropertyError("<Error-Message>")
            ' results.AddPropertyError("<Error-Message>")
            If ExpectedReturnDate < DateOut Then
                results.AddPropertyError("Expected return date must be after checkout date.")
            End If
        End Sub

        Private Sub DateIn_Validate(results As EntityValidationResultsBuilder)
            ' results.AddPropertyError("<Error-Message>")
            If DateIn < DateOut Then
                results.AddPropertyError("Return date must be after checkout date.")
            End If
        End Sub
    End Class

End Namespace
